export default {
    namespaced: true,
    state: {
        isShowToast: false,

        toastMsg: "默认提示内容",
        toastType: 'success'
    },
    mutations: {
        changeIsShowToast(state, payload) {
            state.isShowToast = payload.isshow
            if (payload.isshow) {
                state.toastType = payload.type
                state.toastMsg = payload.msg
            }
            // },
            // changeToastMsg(state, payload) {
            //     state.toastMsg = payload
            // },
            // changeToastType(state, payload) {
            //     state.toastType = payload
            // }
        }
    },
    actions: {
        asyncIsShowToast({ commit }, payload) {
            commit("changeIsShowToast", payload)
            setTimeout(() => {
                commit("changeIsShowToast", {
                    isshow: false
                })
            }, 2000)
        }

    }
}